package com.toman.bean;

import android.app.Activity;

import com.toman.Enum.NetworkEnum;
import com.toman.Enum.TimeEnum;
import com.toman.Enum.ViewTypeEnum;
import com.toman.JavaBean.ImageObject;
import com.toman.camera.Camera;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 邹苏隆 on 2018/11/22.
 * description：
 */
final class TemplateInfBeanBuilder {
    //    是否顶上去
    boolean isMarginTop;
    //    是否可以编辑
    boolean edit;
    private List<ItemListBean> itemListBeans;
    private int inputType;
    private List<TemplateInfBean> listeners = new ArrayList<>(1);
    //    接口类型
    private NetworkEnum network;
    private String companyId;
    private TimeEnum timeEnum;
    private Camera camera;
    private List<ImageObject> problemImageList;
    private Activity activity;
    //    传给服务器的字段名
    private String name;
    //    字段左边的title
        private String title;
    /*字段是否必须*/
    private boolean necessary=false;
    //    有值的时候
    private String content;
    //    上传服务器的数值
    private String result;
    //    布局类型
    private ViewTypeEnum type;

    private TemplateInfBeanBuilder() {
    }

    public static TemplateInfBeanBuilder aTemplateInfBean() {
        return new TemplateInfBeanBuilder();
    }

    public TemplateInfBeanBuilder setItemListBeans(List<ItemListBean> itemListBeans) {
        this.itemListBeans = itemListBeans;
        return this;
    }

    public TemplateInfBeanBuilder setInputType(int inputType) {
        this.inputType = inputType;
        return this;
    }

    public TemplateInfBeanBuilder setListeners(List<TemplateInfBean> listeners) {
        this.listeners = listeners;
        return this;
    }

    public TemplateInfBeanBuilder setNetwork(NetworkEnum network) {
        this.network = network;
        return this;
    }

    public TemplateInfBeanBuilder setCompanyId(String companyId) {
        this.companyId = companyId;
        return this;
    }

    public TemplateInfBeanBuilder setTimeEnum(TimeEnum timeEnum) {
        this.timeEnum = timeEnum;
        return this;
    }

    public TemplateInfBeanBuilder setCamera(Camera camera) {
        this.camera = camera;
        return this;
    }

    public TemplateInfBeanBuilder setProblemImageList(List<ImageObject> problemImageList) {
        this.problemImageList = problemImageList;
        return this;
    }

    public TemplateInfBeanBuilder setActivity(Activity activity) {
        this.activity = activity;
        return this;
    }

    public TemplateInfBeanBuilder setName(String name) {
        this.name = name;
        return this;
    }

    public TemplateInfBeanBuilder setTitle(String title) {
        this.title = title;
        return this;
    }

    public TemplateInfBeanBuilder setNecessary(boolean necessary) {
        this.necessary = necessary;
        return this;
    }

    public TemplateInfBeanBuilder setContent(String content) {
        this.content = content;
        return this;
    }

    public TemplateInfBeanBuilder setResult(String result) {
        this.result = result;
        return this;
    }

    public TemplateInfBeanBuilder setType(ViewTypeEnum type) {
        this.type = type;
        return this;
    }

    public TemplateInfBeanBuilder setIsMarginTop(boolean isMarginTop) {
        this.isMarginTop = isMarginTop;
        return this;
    }

    public TemplateInfBeanBuilder setEdit(boolean edit) {
        this.edit = edit;
        return this;
    }

    public TemplateInfBean build() {
        TemplateInfBean templateInfBean = new TemplateInfBean(name, title, content, result, type, isMarginTop, edit, necessary);
        templateInfBean.setItemListBeans(itemListBeans);
        templateInfBean.setInputType(inputType);
        templateInfBean.setListeners(listeners);
        templateInfBean.setNetwork(network);
        templateInfBean.setCompanyId(companyId);
        templateInfBean.setTimeEnum(timeEnum);
        templateInfBean.setCamera(camera);
        templateInfBean.setProblemImageList(problemImageList);
        templateInfBean.setActivity(activity);
        return templateInfBean;
    }
}
